package ttsolver.variables;


public abstract class DefaultVariable implements Variable,Comparable<Object>
{

   protected final VariableType type;
   protected final Boolean printVar;

   public DefaultVariable(VariableType type)
   {
      this.type = type;
      this.printVar = true;
   }

   public VariableType getType()
   {
      return type;
   }

   public Boolean getPrintVar()
   {
      return printVar;
   }

   @Override
   public int hashCode()
   {
      final int prime = 31;
      int result = 1;
      result = prime * result + ((type == null) ? 0 : type.hashCode());
      return result;
   }

   @Override
   public boolean equals(Object obj)
   {
      if (this == obj)
         return true;
      if (obj == null)
         return false;
      if (getClass() != obj.getClass())
         return false;
      DefaultVariable other = (DefaultVariable) obj;
      if (type != other.type)
         return false;
      return true;
   }
   
   public abstract int compareTo(Object obj);

}
